Ext.define('DutyList.calendar.data.Groups', {
    extend: 'Ext.data.Model',

    requires: [
        'DutyList.calendar.data.User',
        'Ext.data.*',
        'Ext.dd.*'
    ],
    fields : ['i_group', 'name'],
    autoLoad: true,
    proxy:{
        type:'ajax',
		url: "src/data/groupsJS.json",
        reader:{
            type:'json',
            root:'groups',
            successProperty:'success'
        }
    },
    /*proxy: {
        type: 'ajax',
        url : '/groups',
        reader: {
            type: 'json',
            root: 'groups',
            successProperty: 'success'
        },
        writer: {
            type : 'json'
        }
    },*/
    associations: [{
            type: 'hasMany',
            model: 'DutyList.calendar.data.User',
            name: 'users',
            primaryKey: 'i_group',
            foreignKey: 'id_group',
            autoLoad: true
    }] 
});




